package com.etlmaster.rest.agent;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

import com.etlmaster.agent.Task;

/**
 * @author Larry
 * @copyright Larry@etlMaster
 * @since 2017-09-10
 */
@Path("etlmaster")
public class AgentRests {
	@GET
    @Path("startjob")
    @Produces(MediaType.TEXT_PLAIN)
    public String runProc(@QueryParam("jobjson") String jobjson) throws Exception {
		return Task.runTask(jobjson);
    }
	@GET
    @Path("stopAgent")
    @Produces(MediaType.TEXT_PLAIN)
    public String stopAgent() throws Exception {
		System.exit(0);
		return "stoped";
    }
}
